#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

typedef void(^GetGPSFinishBlock)(CLLocation *);

@interface ALGPSManager : NSObject

/// 单例模式构造方法
+ (instancetype)sharedInstance;

/// 获取当前权限
+ (BOOL)allowsToFetchLocation;

/// 获取GPS成功后的回调
@property (nonatomic, strong) GetGPSFinishBlock getGPSSuccess;

/// 获取GPS失败后的回调
@property (nonatomic, strong) GetGPSFinishBlock getGPSFail;

/// 没有GPS权限时的回调
@property (nonatomic, strong) GetGPSFinishBlock getGPSNoPermission;

/// 获取精准的GPS，用于首页、开户等场景GPS校验
- (void)getGPS;

/// 开启定位，获取模糊定位，用于HTTP请求Header中包含GPS信息
- (void)start;

/// 关闭定位
- (void)stop;

/// 获取当前GPS信息
+ (CLLocation *)currentLocation;

@end
